<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  <!ENTITY tex "TeX">
  <!ENTITY latex "LaTeX">
]>
<book id="dragora-handbook.doc" lang="en">
<title>Dragora 3.0 Handbook</title>
<!-- %**end of header -->






<chapter label="" id="Top">
<title></title>

<para>This Handbook is for Dragora
(version 3.0, initial revision, 02 Mar 2024).
</para>
<!-- -*-texinfo-*- -->
<!-- dragora-handbook-menu.texi -->
<!-- This is part of the Dragora Handbook. -->
<!-- Copyright (C) 2021 The Dragora Team. -->
<!-- See the file dragora-handbook-header.texi for copying conditions. -->



<bookinfo><legalnotice><para>Copyright &#169; 2020-2024 The Dragora Team.
</para>
<para>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
</para></legalnotice></bookinfo><para>Copyright &#169; 2020-2024 The Dragora Team.
</para>
<para>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
</para>
<!-- -*-texinfo-*- -->
<!-- dragora-handbook-content.texi -->
<!-- This is part of the Dragora Handbook. -->
<!-- Copyright (C) 2020-2024 The Dragora Team. -->
<!-- See the file dragora-handbook-header.texi for copying conditions. -->

</chapter>
<chapter label="1" id="About-this-handbook">
<title>About this handbook</title>
<indexterm role="cp"><primary>about this handbook</primary></indexterm>

<para>TODO (Add intro + versioning scheme paragraph).
</para>
<sect1 label="1.1">
<title>Typographic conventions</title>
<indexterm role="cp"><primary>typographic conventions</primary></indexterm>

<para>TODO (appendix).
</para>
</sect1>
</chapter>
<chapter label="" id="Revision-history-_0028ChangeLog_0029">
<title>Revision history (ChangeLog)</title>
<indexterm role="cp"><primary>revision history (changelog)</primary></indexterm>

<para>TODO (appendix).
</para>
</chapter>
<chapter label="2" id="What-is-Dragora_003f">
<title>What is Dragora?</title>
<indexterm role="cp"><primary>what is dragora?</primary></indexterm>

<para><emphasis role="bold">Dragora</emphasis> is an independent GNU/Linux distribution project which
was created from scratch with the intention of providing a reliable
operating system with maximum respect for the user by including entirely
free software.  <emphasis role="bold">Dragora</emphasis> is based on the concepts of simplicity
and elegance, it offers a user-friendly Unix-like environment with
emphasis on stability and security for long-term durability.
</para>
<para>To put it in a nutshell, <emphasis role="bold">Dragora</emphasis> is...
</para><itemizedlist><listitem><para>Minimalist.
</para></listitem><listitem><para>Free as in freedom.
</para></listitem><listitem><para>Getting better by the day.
</para></listitem><listitem><para>A whole lot of fun (not suitable for old vinegars).
</para></listitem></itemizedlist>
<para>Some of the features of Dragora are:
</para>
<itemizedlist><listitem><para>SysV init as the classic, documented initialization program (PID 1).
</para></listitem><listitem><para>Perp to reliably start, monitor, log and control &quot;critical&quot; system daemons.
</para></listitem><listitem><para>Lightweight alternatives to popular free software; i.e, musl libc, libressl,
      mksh, scron, pkgconf.
</para></listitem><listitem><para>The Trinity Desktop Environment (TDE).
</para></listitem><listitem><para>Window managers such as TWM, DWM.
</para></listitem><listitem><para>Graft for managing multiple packages under a single directory hierarchy
      using symbolic links mechanisms.
</para></listitem><listitem><para>Qi as a simple local package manager that complements Graft to create,
      install, remove and upgrade software packages.
</para></listitem></itemizedlist>
<sect1 label="2.1">
<title>Free software</title>
<indexterm role="cp"><primary>free software</primary></indexterm>

<para>TODO.
</para>
</sect1>
<sect1 label="2.2">
<title>GNU</title>
<indexterm role="cp"><primary>gnu</primary></indexterm>

<para>TODO.
</para>
</sect1>
<sect1 label="2.3">
<title>Linux and Linux-libre</title>
<indexterm role="cp"><primary>linux or linux-libre</primary></indexterm>

<para>TODO.
</para>
</sect1>
</chapter>
<chapter label="3" id="Why-should-I-use-Dragora_003f">
<title>Why should I use Dragora?</title>
<indexterm role="cp"><primary>why should I use dragora?</primary></indexterm>

<para>We cannot and do not intend to decide for you, we can only cite what we
believe to be Dragora&#8217;s main strengths:
</para>
<itemizedlist><listitem><para><emphasis role="bold">Independent</emphasis>:
As mentioned before, Dragora is an independent project, this means that it
is based on a voluntary basis where one or more people share the same
direction or intentions for the sake of the project and in benefit of the
free software community.  But above all, it is
not a purely commercial project or one that is made by a company, where they
have commercial interests, and where many times they will do anything to
catch you and see your face for their selfish business.
</para>

</listitem><listitem><para><emphasis role="bold">Simple:</emphasis> The underlying concept of Dragora&#8217;s design philosophy is
simplicity: KISS, &quot;Keep It Simple, Stupid!&quot;. This principle, which derives
from what is known as &quot;Ockham&#8217;s razor,&quot; was developed by the first modern
critical philosopher: William of Ockham. We believe this concept represents
the traditional UNIX philosophy - so we don&#8217;t add functionality
unnecessarily, nor do we duplicate information.
</para>
</listitem><listitem><para><emphasis role="bold">Ethical:</emphasis> We try to ensure that the included software is
completely free and allows you to legally run, copy, distribute, study,
change and improve the software.
</para>
</listitem><listitem><para><emphasis role="bold">Language:</emphasis> Native support.
</para>
</listitem><listitem><para><emphasis role="bold">Community:</emphasis> Dragora is not a closed project. On the contrary, anyone
person with good intentions is welcome - and encouraged! - to join and help.
</para></listitem></itemizedlist>
</chapter>
<chapter label="4" id="History">
<title>History</title>
<indexterm role="cp"><primary>history</primary></indexterm>

<para>Development of Dragora started in 2007 by Matias Andres Fonzo from
Santiago del Estero, Argentina.  After one year of hard work, the first
beta of Dragora was released on June 13, 2008, which contained the basic
GNU toolset, boot scripts, package system, and an installer.
Whereas the intention was to achieve a 100% &quot;free&quot; as in freedom
GNU/Linux distribution from the beginning, this very first version was not
fully free (or libre) since all parts were free software, except for the
Linux Kernel due to blobs or non-free parts.  Fortunately, the Linux-Libre
project appears that same year, which removes or cleans the non-free parts
of the official versions of the Linux Kernel.  This led to the second beta
of Dragora on September 18, 2008; completing distribution&#8217;s freedom by
replacing the Kernel, and becoming the first one available to the public.
Ongoing work to provide a more complete distribution would result in the
stable release of Dragora 1.0, achieved on March 13, 2009.  The series
ends with the massive update plus fixes and added software for version
1.1 released on October 8, 2009.
</para>
<para>Design of this series was based on a traditional GNU/Linux scheme with
SysVinit as the init system but using BSD-style boot scripts. The package
system, the installer, the text menu-mode tools and the boot scripts were
all written using the syntax and the features offered by GNU Bash.
Initially the binary packages were provided in .tbz2 format (files
compressed with bzip2 and packaged using GNU Tar) which later migrated to
the .tlz format (files compressed with lzip for a higher compression plus
very safe integrity checking).  Dragora&#8217;s installer offered the option of
several languages (translations produced by the community) to choose
between English, Galician, Italian, and Spanish.  A second CD included the
packages for the K Desktop Environment (KDE) 3 series.
</para>
<sect1 label="4.1">
<title>Releases</title>
<indexterm role="cp"><primary>releases</primary></indexterm>

<para>Below are the dates and code names used for all the Dragora releases:
</para>
<itemizedlist><listitem><para><emphasis><emphasis role="bold">Dragora 1.0 Beta 1:</emphasis> June 13th, 2008 - &quot;hell&quot;.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 1.0 Beta 2:</emphasis> September 18th, 2008.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 1.0 Release Candidate 1:</emphasis> February 12th, 2009.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 1.0 Stable:</emphasis> March 13th, 2009 - &quot;starlight&quot;.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 1.1 Release Candidate 1:</emphasis> August 25th, 2009.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 1.1 Stable:</emphasis> October 8th, 2009 - &quot;stargazer&quot;.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.0 Release Candidate 1:</emphasis> January 24th, 2010.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.0 Release Candidate 2:</emphasis> March 28th, 2010.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.0 Stable:</emphasis> April 13th, 2010 - &quot;ardi&quot;.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.1 Release Candidate 1:</emphasis> December 4th, 2010.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.1 Stable:</emphasis> December 31st, 2010 - &quot;dio&quot;.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.2 Release Candidate 1:</emphasis> March 2nd, 2012.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 2.2 Stable:</emphasis> April 21st, 2012 - &quot;rafaela&quot;.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 3.0 Alpha 1:</emphasis> December 31st, 2017.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 3.0 Alpha 2:</emphasis> September 28th, 2018.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 3.0 Beta 1:</emphasis> October 16th, 2019.</emphasis>
</para></listitem><listitem><para><emphasis><emphasis role="bold">Dragora 3.0 Beta 2:</emphasis> April 26th, 2023.</emphasis>
</para></listitem></itemizedlist>
</sect1>
</chapter>
<chapter label="5" id="Maintainers">
<title>Maintainers</title>
<indexterm role="cp"><primary>maintainers</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="6" id="A-quick-glance-at-Dragora">
<title>A quick glance at Dragora</title>
<indexterm role="cp"><primary>a quick glance at dragora</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="7" id="Boot-options-from-live-medium">
<title>Boot options from live medium</title>
<indexterm role="cp"><primary>boot options from live medium</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="8" id="Using-dragora_002dinstaller">
<title>Using dragora-installer</title>
<indexterm role="cp"><primary>using dragora-installer</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="9" id="Installing-the-system-manually-_0028as-an-alternative_0029">
<title>Installing the system manually (as an alternative)</title>
<indexterm role="cp"><primary>installing the system manually (as an alternative)</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="10" id="Introduction-to-package-management-in-Dragora">
<title>Introduction to package management in Dragora</title>
<indexterm role="cp"><primary>package management in dragora</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="11" id="Package-management-in-a-nutshell">
<title>Package management in a nutshell</title>
<indexterm role="cp"><primary>package management in a nutshell</primary></indexterm>

<para>TODO.
</para>
</chapter>
<chapter label="" id="Using-third_002dparty-free-software">
<title>Using third-party free software</title>
<indexterm role="cp"><primary>using third-party free software</primary></indexterm>

<para>TODO (appendix).
</para>
<!-- -*-texinfo-*- -->
<!-- qi-content.texi -->
<!-- This is part of the Qi user guide. -->
<!-- Copyright (C) 2019-2022 Matias Fonzo, <selk@dragora.org>. -->
<!-- See the file qi-header.texi for copying conditions. -->
<!-- -->
<!-- If something is modified here, be aware of the increase of VERSION in -->
<!-- qi-header.texi, this will produce the result of the manual: qi.info -->

</chapter>
<chapter label="12" id="Introduction-to-Qi">
<title>Introduction to Qi</title>
<indexterm role="cp"><primary>introduction to qi</primary></indexterm>

<para>Qi is a simple but well-integrated package manager.  It can create,
install, remove, and upgrade software packages.  Qi produces binary
packages using recipes, which are files containing specific instructions
to build each package from source.  Qi can manage multiple packages
under a single directory hierarchy.  This method allows to maintain a set
of packages and multiple versions of them.  This means that Qi could be
used as the main package manager or complement the existing one.
</para>
<para>Qi offers a friendly command line interface, a global configuration
file, a simple recipe layout to deploy software packages; also works
with binary packages in parallel, speeding up installations and packages
in production.  The format used for packages is a simplified and safer
variant of POSIX pax archive compressed in lzip format.
</para>
<para>Qi is a modern (POSIX-compliant) shell script released under the
terms of the GNU General Public License.  There are only two major
dependencies for the magic: graft(1) and tarlz(1), the rest is expected
to be found in any Unix-like system.
</para>
</chapter>
<chapter label="13" id="Invoking-qi">
<title>Invoking qi</title>
<indexterm role="cp"><primary>invocation</primary></indexterm>

<para>This chapter describes the synopsis for invoking Qi.
</para>
<screen>Usage: qi COMMAND [<replaceable>OPTION</replaceable>...] [<replaceable>FILE</replaceable>]...
</screen>
<para>One mandatory command specifies the operation that &#8216;<literal>qi</literal>&#8217; should
perform, options are meant to detail how this operation should be
performed during or after the process.
</para>
<para>Qi supports the following commands:
</para>
<variablelist><varlistentry><term><literal>warn</literal>
</term><listitem><para>Warn about files that will be installed.
</para>
</listitem></varlistentry><varlistentry><term><literal>install</literal>
</term><listitem><para>Install packages.
</para>
</listitem></varlistentry><varlistentry><term><literal>remove</literal>
</term><listitem><para>Remove packages.
</para>
</listitem></varlistentry><varlistentry><term><literal>upgrade</literal>
</term><listitem><para>Upgrade packages.
</para>
</listitem></varlistentry><varlistentry><term><literal>extract</literal>
</term><listitem><para>Extract packages for debugging purposes.
</para>
</listitem></varlistentry><varlistentry><term><literal>create</literal>
</term><listitem><para>Create a .tlz package from directory.
</para>
</listitem></varlistentry><varlistentry><term><literal>build</literal>
</term><listitem><para>Build packages using recipe names.
</para>
</listitem></varlistentry><varlistentry><term><literal>order</literal>
</term><listitem><para>Resolve build order through .order files
</para></listitem></varlistentry></variablelist>
<para>Options when installing, removing, or upgrading software packages:
</para>
<variablelist><varlistentry><term><literal>-f</literal>
</term><term><literal>--force</literal>
</term><listitem><para>Force upgrade of pre-existing packages.
</para>
</listitem></varlistentry><varlistentry><term><literal>-k</literal>
</term><term><literal>--keep</literal>
</term><listitem><para>Keep directories when build/remove/upgrade.
</para>
<para>Keep (don&#8217;t delete) the package directory when using remove/upgrade command.
</para>
<para>This will also try to preserve the directories &#8216;<literal>${srcdir}</literal>&#8217; and
&#8216;<literal>${destdir}</literal>&#8217; when using build command.  Its effect is available in
recipes as &#8216;<literal>${keep_srcdir}</literal>&#8217; and &#8216;<literal>${keep_destdir}</literal>&#8217;.  See
<link linkend="Recipes">Special variables</link> for details.
</para>
</listitem></varlistentry><varlistentry><term><literal>-p</literal>
</term><term><literal>--prune</literal>
</term><listitem><para>Prune conflicts.
</para>
</listitem></varlistentry><varlistentry><term><literal>-P</literal>
</term><term><literal>--packagedir=&lt;dir&gt;</literal>
</term><listitem><para>Set directory for package installations.
</para>
</listitem></varlistentry><varlistentry><term><literal>-t</literal>
</term><term><literal>--targetdir=&lt;dir&gt;</literal>
</term><listitem><para>Set target directory for symbolic links.
</para>
</listitem></varlistentry><varlistentry><term><literal>-r</literal>
</term><term><literal>--rootdir=&lt;dir&gt;</literal>
</term><listitem><para>Use the fully qualified named directory as the root directory for all qi
operations.
</para>
<para>Note: the target directory and the package directory will be
relative to the specified directory, excepting the graft log file.
</para></listitem></varlistentry></variablelist>
<para>Options when building software packages using recipes:
</para>
<variablelist><varlistentry><term><literal>-a</literal>
</term><term><literal>--architecture</literal>
</term><listitem><para>Set architecture name for the package.
</para>
</listitem></varlistentry><varlistentry><term><literal>-j</literal>
</term><term><literal>--jobs</literal>
</term><listitem><para>Parallel jobs for the compiler.
</para>
<para>This option sets the variable &#8216;<literal>${jobs}</literal>&#8217;.  If not specified, default
sets to 1.
</para>
</listitem></varlistentry><varlistentry><term><literal>-S</literal>
</term><term><literal>--skip-questions</literal>
</term><listitem><para>Skip questions on completed recipes.
</para>
</listitem></varlistentry><varlistentry><term><literal>-1</literal>
</term><term><literal>--increment</literal>
</term><listitem><para>Increment release number (&#8216;<literal>${release}</literal>&#8217; + 1).
</para>
<para>The effect of this option will be omitted if &#8211;no-package is being used.
</para>
</listitem></varlistentry><varlistentry><term><literal>-n</literal>
</term><term><literal>--no-package</literal>
</term><listitem><para>Do not create a .tlz package.
</para>
</listitem></varlistentry><varlistentry><term><literal>-i</literal>
</term><term><literal>--install</literal>
</term><listitem><para>Install package after the build.
</para>
</listitem></varlistentry><varlistentry><term><literal>-u</literal>
</term><term><literal>--upgrade</literal>
</term><listitem><para>Upgrade package after the build.
</para>
</listitem></varlistentry><varlistentry><term><literal>-o</literal>
</term><term><literal>--outdir=&lt;dir&gt;</literal>
</term><listitem><para>Where the packages produced will be written.
</para>
<para>This option sets the variable &#8216;<literal>${outdir}</literal>&#8217;.
</para>
</listitem></varlistentry><varlistentry><term><literal>-w</literal>
</term><term><literal>--worktree=&lt;dir&gt;</literal>
</term><listitem><para>Where archives, patches, recipes are expected.
</para>
<para>This option sets the variable &#8216;<literal>${worktree}</literal>&#8217;.
</para>
</listitem></varlistentry><varlistentry><term><literal>-s</literal>
</term><term><literal>--sourcedir=&lt;dir&gt;</literal>
</term><listitem><para>Where compressed sources will be found.
</para>
<para>This option sets the variable &#8216;<literal>${tardir}</literal>&#8217;.
</para></listitem></varlistentry></variablelist>
<para>Other options:
</para>
<variablelist><varlistentry><term><literal>-v</literal>
</term><term><literal>--verbose</literal>
</term><listitem><para>Be verbose (an extra -v gives more).
</para>
<para>It sets the verbosity level, default sets to 0.
</para>
<para>The value 1 is used for more verbosity while the value 2 is too detailed.
Although at the moment it is limited to graft(1) verbosity.
</para>
</listitem></varlistentry><varlistentry><term><literal>-N</literal>
</term><term><literal>--no-rc</literal>
</term><listitem><para>Do not read the configuration file.
</para>
<para>This will ignore reading the qirc file.
</para>
</listitem></varlistentry><varlistentry><term><literal>-L</literal>
</term><term><literal>--show-location</literal>
</term><listitem><para>Print default directory locations and exit.
</para>
<para>This will print the target directory, package directory, working tree,
the directory for sources, and the output directory for the packages
produced.  The output will appear on STDOUT as follows:
</para>
<screen>QI_TARGETDIR=/usr/local
QI_PACKAGEDIR=/usr/local/pkgs
QI_WORKTREE=/usr/src/qi
QI_TARDIR=/usr/src/qi/sources
QI_OUTDIR=/var/cache/qi/packages
</screen>
<para>You can set these environment variables using one of the following methods:
</para>
<para><literal>eval &quot;$(qi -L)&quot;</literal>
</para>
<para>This will display the default locations taking into account the values set
from the qirc configuration file.  You can deny the influence of the
configuration file by setting the option &#8216;<literal>-N</literal>&#8217;.
</para>
<para><literal>eval &quot;$(qi -N -L)&quot;</literal>
</para>
<para>Or you can adjust the new locations using the command-line options, e.g:
</para>
<para><literal>eval &quot;$(qi -N --targetdir=/directory -L)&quot;</literal>
</para>
</listitem></varlistentry><varlistentry><term><literal>-h</literal>
</term><term><literal>--help</literal>
</term><listitem><para>Display the usage and exit.
</para>
</listitem></varlistentry><varlistentry><term><literal>-V</literal>
</term><term><literal>--version</literal>
</term><listitem>
<para>This will print the (short) version information and then exit.
</para>
<para>The same can be achieved if Qi is invoked as &#8216;<literal>qi version</literal>&#8217;.
</para></listitem></varlistentry></variablelist>
<para>When FILE is -, qi can read from the standard input.  See examples from
the <link linkend="Packages">Packages</link> section.
</para>
<para>Exit status: 0 for a normal exit, 1 for minor common errors (help usage,
support not available, etc), 2 to indicate a command execution error;
3 for integrity check error on compressed files, 4 for empty, not
regular, or expected files, 5 for empty or not defined variables,
6 when a package already exist, 10 for network manager errors.
For more details, see the <link linkend="Qi-exit-status">Qi exit status</link> section.
</para>

</chapter>
<chapter label="14" id="The-qirc-file">
<title>The qirc file</title>
<indexterm role="cp"><primary>configuration file</primary></indexterm>

<para>The global <filename>qirc</filename> file offers a way to define variables and tools
(such as a download manager) for default use.  This file is used by qi
at runtime, e.g., to build, install, remove or upgrade packages.
</para>
<para>Variables and their possible values must be declared as any other
variable in the shell.
</para>
<para>The command line options related to the package directory and target
directory and some of the command line options used for the build command,
have the power to override the values declared on <filename>qirc</filename>.
See <link linkend="Invoking-qi">Invoking qi</link>.
</para>
<para>The order in which qi looks for this file is:
</para>
<orderedlist numeration="arabic"><listitem><para><envar>${HOME}/.qirc</envar>
 Effective user.
</para>
</listitem><listitem><para>&#8216;<literal>${sysconfdir}/qirc</literal>&#8217;
 System-wide.
</para></listitem></orderedlist>
<para>If you intend to run qi as effective user, the file
&#8216;<literal>${sysconfdir}/qirc</literal>&#8217; could be copied to <envar>${HOME}/.qirc</envar>
setting the paths for &#8216;<literal>${packagedir}</literal>&#8217; and &#8216;<literal>${targetdir}</literal>&#8217;
according to the <envar>$HOME</envar>.
</para>

</chapter>
<chapter label="15" id="Packages">
<title>Packages</title>
<indexterm role="cp"><primary>managing packages</primary></indexterm>

<para>A package is a suite of programs usually distributed in binary form
which may also contain manual pages, documentation, or any other file
associated to a specific software.
</para>
<para>The package format used by qi is a simplified POSIX pax archive
compressed using lzip<footnote><para>For more details about tarlz and the
lzip format, visit <ulink url="https://lzip.nongnu.org/tarlz.html">https://lzip.nongnu.org/tarlz.html</ulink>.</para></footnote>.  The
file extension for packages ends in &#8216;<literal>.tlz</literal>&#8217;.
</para>
<para>Both package installation and package de-installation are managed using
two important (internal) variables: &#8216;<literal>${packagedir}</literal>&#8217; and
&#8216;<literal>${targetdir}</literal>&#8217;, these values can be changed in the
configuration file or via options.
</para>
<para>&#8216;<literal>${packagedir}</literal>&#8217; is a common directory tree where the package
contents will be decompressed (will reside).
</para>
<para>&#8216;<literal>${targetdir}</literal>&#8217; is a target directory where the links will be
made by graft(1) taking &#8216;<literal>${packagedir}/package_name</literal>&#8217; into account.
</para>
<para>Packages are installed in self-contained directory trees and symbolic
links from a common area are made to the package files.  This allows
multiple versions of the same package to coexist on the same system.
</para>
<sect1 label="15.1">
<title>Package conflicts</title>
<indexterm role="cp"><primary>package conflicts</primary></indexterm>

<para>All the links to install or remove a package are handled by graft(1).
Since multiple packages can be installed or removed at the same time,
certain conflicts may arise between the packages.
</para>
<para>graft<footnote><para>The official guide for Graft can be found at
<ulink url="https://peters.gormand.com.au/Home/tools/graft/graft.html">https://peters.gormand.com.au/Home/tools/graft/graft.html</ulink>.</para></footnote>
defines a CONFLICT as one of the following conditions:
</para>
<itemizedlist><listitem><para>If the package object is a directory and the target object exists but is
not a directory.
</para>
</listitem><listitem><para>If the package object is not a directory and the target object exists
and is not a symbolic link.
</para>
</listitem><listitem><para>If the package object is not a directory and the target object exists
and is a symbolic link to something other than the package object.
</para></listitem></itemizedlist>
<para>The default behavior of qi for an incoming package is to ABORT if a
conflict arises.  When a package is going to be deleted, qi tells to
graft(1) to remove those parts that are not in conflict, leaving the
links to the belonging package.  This behavior can be forced if the
&#8211;prune option is given.
</para>
</sect1>
<sect1 label="15.2">
<title>Installing packages</title>
<indexterm role="cp"><primary>package installation</primary></indexterm>

<para>To install a single package, simply type:
</para>
<screen>qi install coreutils_8.30_i586-1@tools.tlz
</screen>
<para>To install multiple packages at once, type:
</para>
<screen>qi install gcc_8.3.0_i586-1@devel.tlz rafaela_2.2_i586-1@legacy.tlz ...
</screen>
<para>Warn about the files that will be linked:
</para>
<screen>qi warn bash_5.0_i586-1@shells.tlz
</screen>
<para>This is to verify the content of a package before installing it.
</para>
<para>See the process of an installation:
</para>
<screen>qi install --verbose mariana_3.0_i586-1@woman.tlz
</screen>
<para>A second &#8211;verbose or -v option gives more (very verbose).
</para>
<para>Installing package in a different location:
</para>
<screen>qi install --rootdir=/media/floppy lzip_1.21_i586-1@compressors.tlz
</screen>
<para>Important: the &#8211;rootdir option assumes &#8216;<literal>${targetdir}</literal>&#8217; and
&#8216;<literal>${packagedir}</literal>&#8217;.  See the following example:
</para>
<screen>qi install --rootdir=/home/selk lzip_1.21_i586-1@compressors.tlz
</screen>
<para>The content of &quot;lzip_1.21_i586-1@compressors.tlz&quot; will be decompressed
into &#8216;<literal>/home/selk/pkgs/lzip_1.21_i586-1@compressors</literal>&#8217;.
Assuming that the main binary for lzip is under
&#8216;<literal>/home/selk/pkgs/lzip_1.21_i586-1@compressors/usr/bin/</literal>&#8217;
the target for &quot;usr/bin&quot; will be created at &#8216;<literal>/home/selk</literal>&#8217;.  Considering
that you have exported the <envar>PATH</envar> as &#8216;<literal>${HOME}/usr/bin</literal>&#8217;, now the
system is able to see the recent lzip command.
</para>
<para>Installing from a list of packages using standard input:
</para>
<screen>qi install - &lt; PACKAGELIST.txt
</screen>
<para>Or in combination with another tool:
</para><screen>sort -u PACKAGELIST.txt | qi install -
</screen>
<para>The sort command will read and sorts the list of declared packages,
while trying to have unique entries for each statement.  The output
produced is captured by Qi to install each package.
</para>
<para>An example of a list containing package names is:
</para><screen>/var/cache/qi/packages/amd64/tcl_8.6.9_amd64-1@devel.tlz
/var/cache/qi/packages/amd64/tk_8.6.9.1_amd64-1@devel.tlz
/var/cache/qi/packages/amd64/vala_0.42.3_amd64-1@devel.tlz
</screen>
</sect1>
<sect1 label="15.3">
<title>Removing packages</title>
<indexterm role="cp"><primary>package de-installation</primary></indexterm>

<para>To remove a package, simply type:
</para>
<screen>qi remove xz_5.2.4_i586-1@compressors.tlz
</screen>
<para>Remove command will match the package name using &#8216;<literal>${packagedir}</literal>&#8217; as
prefix.  For example, if the value of &#8216;<literal>${packagedir}</literal>&#8217; has been
set to /usr/pkg, this will be equal to:
</para>
<screen>qi remove /usr/pkg/xz_5.2.4_i586-1@compressors
</screen>
<para>Detailed output:
</para>
<screen>qi remove --verbose /usr/pkg/xz_5.2.4_i586-1@compressors
</screen>
<para>A second &#8211;verbose or -v option gives more (very verbose).
</para>
<para>By default the remove command does not preserve a package directory after
removing its links from &#8216;<literal>${targetdir}</literal>&#8217;, but this behavior can be
changed if the &#8211;keep option is passed:
</para>
<screen>qi remove --keep /usr/pkg/lzip_1.21_i586-1@compressors
</screen>
<para>This means that the links to the package can be reactivated, later:
</para>
<screen>cd /usr/pkg &amp;&amp; graft -i lzip_1.21_i586-1@compressors
</screen>
<para>Removing package from a different location:
</para>
<screen>qi remove --rootdir=/home/cthulhu xz_5.2.4_i586-1@compressors
</screen>
<para>Removing a package using standard input:
</para>
<screen>echo vala_0.42.3_amd64-1@devel | qi remove -
</screen>
<para>This will match with the package directory.
</para>
</sect1>
<sect1 label="15.4">
<title>Upgrading packages</title>
<indexterm role="cp"><primary>package upgrade</primary></indexterm>

<para>The upgrade command inherits the properties of the installation and removal
process.  To make sure that a package is updated, the package is installed
in a temporary directory taking &#8216;<literal>${packagedir}</literal>&#8217; into account.  Once
the incoming package is pre-installed, qi can proceed to search and delete
packages that have the same name (considered as previous ones).  Finally,
the package is re-installed at its final location and the temporary
directory is removed.
</para>
<para>Since updating a package can be crucial and so to perform a successful
upgrade, from start to finish, you will want to ignore some important
system signals during the upgrade process, those signals are SIGHUP,
SIGINT, SIGQUIT, SIGABRT, and SIGTERM.
</para>
<para>To upgrade a package, just type:
</para>
<screen>qi upgrade gcc_9.0.1_i586-1@devel.tlz
</screen>
<para>This will proceed to upgrade &quot;gcc_9.0.1_i586-1@devel&quot; removing any other
version of &quot;gcc&quot; (if any).
</para>
<para>If you want to keep the package directories of versions found during the
upgrade process, just pass:
</para>
<screen>qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
</screen>
<para>To see the upgrade process:
</para>
<screen>qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
</screen>
<para>A second &#8211;verbose or -v option gives more (very verbose).
</para>
<para>To force the upgrade of an existing package:
</para>
<screen>qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
</screen>
<sect2 label="15.4.1">
<title>Package blacklist</title>
<indexterm role="cp"><primary>package blacklist</primary></indexterm>

<para>To implement general package facilities, either to install, remove or
maintain the hierarchy of packages in a clean manner, qi makes use of the
pruning operation via graft(1) by default:
</para>
<para>There is a risk if those are crucial packages for the proper functioning
of the system, because it implies the deactivation of symbolic from the
target directory, <emphasis>especially</emphasis> when transitioning an incoming package
into its final location during an upgrade.
</para>
<para>A blacklist of package names has been devised for the case where
a user decides to upgrade all the packages in the system, or
just the crucial ones, such as the C library.
</para>
<para>The blacklist is related to the upgrade command only, consists in installing
a package instead of updating it or removing previous versions of it;
the content of the package will be updated over the existing content at
&#8216;<literal>${packagedir}</literal>&#8217;, while the existing links from
&#8216;<literal>${targetdir}</literal>&#8217; will be preserved.  A pruning of links will be
carried out in order to re-link possible differences with the recent
content, this helps to avoid leaving dead links in the target directory.
</para>
<para>Package names for the blacklist to be declared must be set from the
configuration file.  By default, it is declared using the package name,
which is more than enough for critical system packages, but if you want to
be more specific, you can declare a package using:
&#8216;<literal>${pkgname}_${pkgversion}_${arch}-${release}</literal>&#8217; where
the package category is avoided for common matching.  See
<link linkend="Recipes">Special variables</link> for a description of these variables.
</para>
</sect2>
</sect1>
</chapter>
<chapter label="16" id="Recipes">
<title>Recipes</title>
<indexterm role="cp"><primary>recipes</primary></indexterm>

<para>A recipe is a file telling qi what to do.  Most often, the recipe tells
qi how to build a binary package from a source tarball.
</para>
<para>A recipe has two parts: a list of variable definitions and a list of
sections.  By convention, the syntax of a section is:
</para>
<screen>section_name()
{
    section lines
}
</screen>
<para>The section name is followed by parentheses, one newline and an opening
brace.  The line finishing the section contains just a closing brace.
The section names or the function names currently recognized are
&#8216;<literal>build</literal>&#8217;.
</para>
<para>The &#8216;<literal>build</literal>&#8217; section (or <emphasis role="bold">shell function</emphasis>) is an augmented
shell script that contains the main instructions to build software
from source.
</para>
<para>If there are other functions defined by the packager, Qi detects them
for later execution.
</para>
<sect1 label="16.1">
<title>Variables</title>
<indexterm role="cp"><primary>variables</primary></indexterm>

<para>A &quot;variable&quot; is a <emphasis role="bold">shell variable</emphasis> defined either in <filename>qirc</filename>
or in a recipe to represent a string of text, called the variable&#8217;s
&quot;value&quot;.  These values are substituted by explicit request in the
definitions of other variables or in calls to external commands.
</para>
<para>Variables can represent lists of file names, options to pass to
compilers, programs to run, directories to look in for source files,
directories to write output to, or anything else you can imagine.
</para>
<para>Definitions of variables in qi have four levels of precedence.
Options which define variables from the command-line override those
specified in the <filename>qirc</filename> file, while variables defined in the recipe
override those specified in <filename>qirc</filename>, taking priority over those
variables set by command-line options.  Finally, the variables have
default values if they are not defined anywhere.
</para>
<para>Options that set variables through the command-line can only reference
variables defined in <filename>qirc</filename> and variables with default values.
</para>
<para>Definitions of variables in <filename>qirc</filename> can only reference variables
previously defined in <filename>qirc</filename> and variables with default values.
</para>
<para>Definitions of variables in the recipe can only reference variables
set by the command-line, variables previously defined in the recipe,
variables defined in <filename>qirc</filename>, and variables with default values.
</para>
</sect1>
<sect1 label="16.2">
<title>Special variables</title>
<indexterm role="cp"><primary>special variables</primary></indexterm>

<para>There are variables which can only be set using the command line options or
via <filename>qirc</filename>, there are other special variables which can be defined or
redefined in a recipe.  See the following definitions:
</para>
<para>&#8216;<literal>outdir</literal>&#8217; is the directory where the packages produced are written.
This variable can be redefined per-recipe.  Default sets to
&#8216;<literal>/var/cache/qi/packages</literal>&#8217;.
</para>
<para>&#8216;<literal>worktree</literal>&#8217; is the working tree where archives, patches, and recipes
are expected.  This variable can not be redefined in the recipe.  Default
sets to &#8216;<literal>/usr/src/qi</literal>&#8217;.
</para>
<para>&#8216;<literal>tardir</literal>&#8217; is defined in the recipe to the directory where the tarball
containing the source can be found.  The full name of the tarball is
composed as &#8216;<literal>${tardir}/$tarname</literal>&#8217;.  Its value is available in the
recipe as &#8216;<literal>${tardir}</literal>&#8217;; a value of . for &#8216;<literal>tardir</literal>&#8217; sets it to
the value of CWD (Current Working Directory), this is where the recipe
lives.
</para>
<para>&#8216;<literal>arch</literal>&#8217; is the architecture to compose the package name.  Its value is
available in the recipe as &#8216;<literal>${arch}</literal>&#8217;.  Default value is the one
that was set in the Qi configuration.
</para>
<para>&#8216;<literal>jobs</literal>&#8217; is the number of parallel jobs to pass to the compiler.  Its
value is available in the recipe as &#8216;<literal>${jobs}</literal>&#8217;.  The default value
is 1.
</para>
<para>The two variables &#8216;<literal>${srcdir}</literal>&#8217; and &#8216;<literal>${destdir}</literal>&#8217; can be
set in the recipe, as any other variable, but if they are not, qi uses
default values for them when building a package.
</para>
<para>&#8216;<literal>srcdir</literal>&#8217; contains the source code to be compiled, and defaults to
&#8216;<literal>${program}-${version}</literal>&#8217;.  &#8216;<literal>destdir</literal>&#8217; is the place where the
built package will be installed, and defaults to
&#8216;<literal>${TMPDIR}/package-${program}</literal>&#8217;.
</para>
<para>If &#8216;<literal>pkgname</literal>&#8217; is left undefined, the special variable &#8216;<literal>program</literal>&#8217;
is assigned by default.  If &#8216;<literal>pkgversion</literal>&#8217; is left undefined, the
special variable &#8216;<literal>version</literal>&#8217; is assigned by default.
</para>
<para>&#8216;<literal>pkgname</literal>&#8217; and &#8216;<literal>pkgversion</literal>&#8217; along with: &#8216;<literal>version</literal>&#8217;, &#8216;<literal>arch</literal>&#8217;,
&#8216;<literal>release</literal>&#8217;, and (optionally) &#8216;<literal>pkgcategory</literal>&#8217; are used to produce the
package name in the form:
&#8216;<literal>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz</literal>&#8217;
</para>
<para>&#8216;<literal>pkgcategory</literal>&#8217; is an optional special variable that can be defined on the
recipe to categorize the package name.  If it is defined, then the
package output will be composed as
&#8216;<literal>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz</literal>&#8217;.
Automatically, the value of &#8216;<literal>pkgcategory</literal>&#8217; will be prefixed using the
&#8216;<literal>@</literal>&#8217; (at) symbol which will be added to the last part of the package name.
</para>
<para>A special variable called &#8216;<literal>replace</literal>&#8217; can be used to declare package names
that will be replaced at installation time.
</para>
<para>The special variables &#8216;<literal>keep_srcdir</literal>&#8217; and &#8216;<literal>keep_destdir</literal>&#8217; are provided
in order to preserve the directories &#8216;<literal>${srcdir}</literal>&#8217; or &#8216;<literal>${destdir}</literal>&#8217;,
if those exists as such.  Note: The declaration of these variables are subject
to manual deactivation; its purpose in recipes is to preserve the directories
that relate to the package&#8217;s build (source) and destination directory, that is
so that another recipe can get a new package (or meta package) from there.  For
example, the declarations can be done as:
</para>
<screen>keep_srcdir=keep_srcdir
keep_destdir=keep_destdir
</screen>
<para>Then from another recipe you would proceed to copy the necessary files that
will compose the meta package, from the main function you must deactivate
the variables at the end:
</para>
<screen>unset -v keep_srcdir keep_destdir
</screen>
<para>This will leave the &#8217;keep_srcdir&#8217; and &#8217;keep_destdir&#8217; variables blank to
continue with the rest of the recipes.
</para>
<para>The special variable &#8216;<literal>opt_skiprecipe</literal>&#8217; is available when you need to
ignore a recipe cleanly, continuing with the next recipe.  May you add a
conditional test then set it as &#8216;<literal>opt_skiprecipe=opt_skiprecipe</literal>&#8217;.
</para>
<para>The variable &#8216;<literal>tarlz_compression_options</literal>&#8217; can be used to change the
default compression options in tarlz(1), default sets to &#8216;<literal>-9 --solid</literal>&#8217;.
For example if the variable is declared as:
</para>
<screen>tarlz_compression_options=&quot;-0 --bsolid&quot;
</screen>
<para>It will change the granularity of tarlz(1) by using the &#8216;<literal>--bsolid</literal>&#8217;
option <footnote><para>About the &#8216;<literal>--bsolid</literal>&#8217; granularity option of tarlz(1),
<ulink url="https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid">https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid</ulink>.</para></footnote>,
as well as increasing the compression speed by lowering the compression
level with &#8216;<literal>-0</literal>&#8217;.
</para>
<para>This is only recommended for recipes where testing, or faster processing is
desired to create the packaged file more quickly.  It is not recommended for
production or general distribution of binary packages.
</para>
<para>A typical recipe contains the following variables:
</para>
<itemizedlist><listitem><para>&#8216;<literal>program</literal>&#8217;: Software name.
</para>
<para>It matches the source name.  It is also used to compose the name of the
package if &#8216;<literal>${pkgname}</literal>&#8217; is not specified.
</para>
</listitem><listitem><para>&#8216;<literal>version</literal>&#8217;: Software version.
</para>
<para>It matches the source name.  It is also used to compose the version of the
package if &#8216;<literal>${pkgversion}</literal>&#8217; is not specified.
</para>
</listitem><listitem><para>&#8216;<literal>arch</literal>&#8217;: Software architecture.
</para>
<para>It is used to compose the architecture of the package in which it is
build.
</para>
</listitem><listitem><para>&#8216;<literal>release</literal>&#8217;: Release number.
</para>
<para>This is used to reflect the release number of the package.  It is
recommended to increase this number after any significant change in
the recipe or post-install script.
</para>
</listitem><listitem><para>&#8216;<literal>pkgcategory</literal>&#8217;: Package category.
</para>
<para>Optional but recommended variable to categorize the package name when it is
created.
</para></listitem></itemizedlist>
<para>Obtaining sources over the network must be declared in the recipe using
the &#8216;<literal>fetch</literal>&#8217; variable.
</para>
<para>The variables &#8216;<literal>netget</literal>&#8217; and &#8216;<literal>rsync</literal>&#8217; can be defined in <filename>qirc</filename>
to establish a network downloader in order to get the sources.  If they
are not defined, qi uses default values:
</para>
<para>&#8216;<literal>netget</literal>&#8217; is the general network downloader tool, defaults sets to
&#8216;<literal>wget2 -c -w1 -t3 --no-check-certificate</literal>&#8217;.
</para>
<para>&#8216;<literal>rsync</literal>&#8217; is the network tool for sources containing the prefix for
the RSYNC protocol, default sets to
&#8216;<literal>rsync -v -a -L -z -i --progress</literal>&#8217;.
</para>
<para>The variable &#8216;<literal>description</literal>&#8217; is used to print the package description
when a package is installed.
</para>
<para>A description has two parts: a brief description, and a long description.
By convention, the syntax of &#8216;<literal>description</literal>&#8217; is:
</para>
<screen>description=&quot;
Brief description.

Long description.
&quot;
</screen>
<para>The first line of the value represented is a brief description of the
software (called &quot;blurb&quot;).  A blank line separates the <emphasis>brief
description</emphasis> from the <emphasis>long description</emphasis>, which should contain a more
descriptive description of the software.
</para>
<para>An example looks like:
</para>
<screen>description=&quot;
The GNU core utilities.

The GNU core utilities are the basic file, shell and text manipulation
utilities of the GNU operating system.  These are the core utilities
which are expected to exist on every operating system.
&quot;
</screen>
<para>Please consider a length limit of 78 characters as maximum, because the same
one would be used on the meta file creation.  See
<link linkend="Recipes">The meta file</link> section.
</para>
<para>The &#8216;<literal>homepage</literal>&#8217; variable is used to declare the main site or home page:
</para>
<screen>homepage=https://www.gnu.org/software/gcc
</screen>
<para>The variable &#8216;<literal>license</literal>&#8217; is used for license information<footnote><para>The proposal for &#8216;<literal>license</literal>&#8217; was made by Richard M. Stallman at
<ulink url="https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</ulink>.</para></footnote>.
Some code in the program can be covered by license A, license B, or
license C.  For &quot;separate licensing&quot; or &quot;heterogeneous licensing&quot;, we
suggest using <emphasis role="bold">|</emphasis> for a disjunction, <emphasis role="bold">&amp;</emphasis> for a conjunction
(if that ever happens in a significant way), and comma for heterogeneous
licensing.  Comma would have lower precedence, plus added special terms.
</para>
<screen>license=&quot;LGPL, GPL | Artistic - added permission&quot;
</screen>
</sect1>
<sect1 label="16.3">
<title>Writing recipes</title>
<indexterm role="cp"><primary>writing recipes</primary></indexterm>

<para>Originally, Qi was designed for the series of Dragora GNU/Linux-Libre 3;
this doesn&#8217;t mean you can&#8217;t use it in another distribution, just that if
you do, you&#8217;ll have to try it out for yourself. To help with this, here
are some references to well-written recipes:
</para>
<itemizedlist><listitem><para><ulink url="https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</ulink>
</para></listitem><listitem><para><ulink url="https://notabug.org/dragora/dragora/src/master/recipes">https://notabug.org/dragora/dragora/src/master/recipes</ulink>
</para></listitem><listitem><para><ulink url="https://notabug.org/dragora/dragora-extras/src/master/recipes">https://notabug.org/dragora/dragora-extras/src/master/recipes</ulink>
</para></listitem><listitem><para><ulink url="https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes</ulink>
</para></listitem></itemizedlist>
</sect1>
<sect1 label="16.4">
<title>Building packages</title>
<indexterm role="cp"><primary>package build</primary></indexterm>

<para>A recipe is any valid regular file.  Qi sets priorities for reading a
recipe, the order in which qi looks for a recipe is:
</para>
<orderedlist numeration="arabic"><listitem><para>Current working directory.
</para>
</listitem><listitem><para>If the specified path name does not contain &quot;recipe&quot; as the last
component.  Qi will complete it by adding &quot;recipe&quot; to the path name.
</para>
</listitem><listitem><para>If the recipe is not in the current working directory, it will be
searched under &#8216;<literal>${worktree}/recipes</literal>&#8217;.  The last component will be
completed adding &quot;recipe&quot; to the specified path name.
</para></listitem></orderedlist>
<para>To build a single package, type:
</para>
<screen>qi build x-apps/xterm
</screen>
<para>Multiple jobs can be passed to the compiler to speed up the build process:
</para>
<screen>qi build --jobs 3 x-apps/xterm
</screen>
<para>Update or install the produced package (if not already installed) when the
build command ends:
</para>
<screen>qi build -j3 --upgrade x-apps/xterm
</screen>
<para>Only process a recipe but do not create the binary package:
</para>
<screen>qi build --no-package dict/aspell
</screen>
<para>The options &#8211;install or &#8211;upgrade have no effect when &#8211;no-package
is given.
</para>
<para>This is useful to inspect the build process of the above recipe:
</para>
<para>qi build &#8211;keep &#8211;no-package dict/aspell 2&gt;&amp;1 | tee aspell-log.txt
</para>
<para>The &#8211;keep option could preserve the source directory and the destination
directory for later inspection.  A log file of the build process will be
created redirecting both, standard error and standard output to tee(1).
</para>
</sect1>
<sect1 label="16.5">
<title>Variables from the environment</title>
<indexterm role="cp"><primary>environment variables</primary></indexterm>

<para>Qi has environment variables which can be used at build time:
</para>
<para>The variable <envar>TMPDIR</envar> sets the temporary directory for sources, which is
used for package extractions (see <link linkend="Examining-packages">Examining packages</link>) and is
prepended to the value of &#8216;<literal>${srcdir}</literal>&#8217; and &#8216;<literal>${destdir}</literal>&#8217; in
build command.  By convention its default value is equal to
&#8216;<literal>/usr/src/qi/build</literal>&#8217;.
</para>
<para>The variables <envar>QICFLAGS</envar>, <envar>QICXXFLAGS</envar>, <envar>QILDFLAGS</envar>, and
<envar>QICPPFLAGS</envar> have no effect by default.  The environment variables
such as <envar>CFLAGS</envar>, <envar>CXXFLAGS</envar>, <envar>LDFLAGS</envar>, and <envar>CPPFLAGS</envar>
are unset at compile time:
</para>
<para>Recommended practice is to set variables in the command line of
&#8216;<literal>configure</literal>&#8217; or <emphasis>make(1)</emphasis> instead of exporting to the
environment.  As follows:
</para>
<para><ulink url="https://www.gnu.org/software/make/manual/html_node/Environment.html">https://www.gnu.org/software/make/manual/html_node/Environment.html</ulink>
</para><blockquote><para>It is not wise for makefiles to depend for their functioning on environment
variables set up outside their control, since this would cause different
users to get different results from the same makefile.  This is against the
whole purpose of most makefiles.
</para></blockquote>
<para>Setting environment variables for configure is deprecated because running
configure in varying environments can be dangerous.
</para>
<para><ulink url="https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</ulink>
</para><blockquote><para>Variables not defined in a site shell script can be set in the environment
passed to configure.  However, some packages may run configure again
during the build, and the customized values of these variables may be
lost.  In order to avoid this problem, you should set them in the
configure command line, using &#8216;<literal>VAR=value</literal>&#8217;.  For example:
</para>
<para><literal>./configure CC=/usr/local2/bin/gcc</literal>
</para></blockquote>
<para><ulink url="https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</ulink>
</para><blockquote><para>If for instance the user runs &#8216;<literal>CC=bizarre-cc ./configure</literal>&#8217;, then the cache,
config.h, and many other output files depend upon bizarre-cc being the C
compiler.  If for some reason the user runs ./configure again, or if it is
run via &#8216;<literal>./config.status --recheck</literal>&#8217;, (See Automatic Remaking, and see
config.status Invocation), then the configuration can be inconsistent,
composed of results depending upon two different compilers.
[...]
Indeed, while configure can notice the definition of CC in &#8216;<literal>./configure
CC=bizarre-cc</literal>&#8217;, it is impossible to notice it in &#8216;<literal>CC=bizarre-cc
./configure</literal>&#8217;, which, unfortunately, is what most users do.
[...]
configure: error: changes in the environment can compromise the build.
</para></blockquote>
<para>If the <envar>SOURCE_DATE_EPOCH</envar> environment variable is set to a UNIX timestamp
(defined as the number of seconds, excluding leap seconds, since 01 Jan 1970
00:00:00 UTC.); then the given timestamp will be used to overwrite any newer
timestamps on the package contents (when it is created).  More information
about this can be found at
<ulink url="https://reproducible-builds.org/specs/source-date-epoch/">https://reproducible-builds.org/specs/source-date-epoch/</ulink>.
</para>
</sect1>
<sect1 label="16.6">
<title>The meta file</title>
<indexterm role="cp"><primary>the meta file</primary></indexterm>

<para>The &quot;meta file&quot; is a regular file created during the build process, it
contains information about the package such as package name, package
version, architecture, release, fetch address, description, and other
minor data extracted from processed recipes.  The name of the file is
generated as &#8216;<literal>${full_pkgname}.tlz.txt</literal>&#8217;, and its purpose is to
reflect essential information to the user without having to look inside
the package content.  The file format is also intended to be used by
other scripts or by common Unix tools.
</para>
<para>The content of a meta file looks like:
</para>
<screen>#
# Pattern scanning and processing language.
#
# The awk utility interprets a special-purpose programming language
# that makes it possible to handle simple data-reformatting jobs
# with just a few lines of code.  It is a free version of 'awk'.
#
# GNU awk implements the AWK utility which is part of
# IEEE Std 1003.1 Shell and Utilities (XCU).
#

QICFLAGS=&quot;-O2&quot;
QICXXFLAGS=&quot;-O2&quot;
QILDFLAGS=&quot;&quot;
QICPPFLAGS=&quot;&quot;
pkgname=gawk
pkgversion=5.0.1
arch=amd64
release=1
pkgcategory=&quot;tools&quot;
full_pkgname=gawk_5.0.1_amd64-1@tools
blurb=&quot;Pattern scanning and processing language.&quot;
homepage=&quot;https://www.gnu.org/software/gawk&quot;
license=&quot;GPLv3+&quot;
fetch=&quot;https://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz&quot;
replace=&quot;&quot;
</screen>
<para>A package descriptions is extracted from the variable &#8216;<literal>description</literal>&#8217;
where each line is interpreted literally and pre-formatted to fit in
(exactly) <emphasis role="bold">80 columns</emphasis>, plus the character &#8216;<literal>#</literal>&#8217; and a blank
space is prefixed to every line (shell comments).
</para>
<para>In addition to the Special variables, there are implicit variables such as
&#8216;<literal>blurb</literal>&#8217;:
</para>
<para>The &#8216;<literal>blurb</literal>&#8217; variable is related to the special variable
&#8216;<literal>description</literal>&#8217;.  Its value is made from the first (substantial)
line of &#8216;<literal>description</literal>&#8217;, mentioned as the &quot;brief description&quot;.
</para>
<para>The build flags such as &#8216;<literal>QICFLAGS</literal>&#8217;, &#8216;<literal>QICXXFLAGS</literal>&#8217;,
&#8216;<literal>QILDFLAGS</literal>&#8217;, and &#8216;<literal>QICPPFLAGS</literal>&#8217; are only added to the meta file
if the declared variable &#8216;<literal>arch</literal>&#8217; is not equal to the &quot;noarch&quot; value.
</para>
</sect1>
</chapter>
<chapter label="17" id="Order-files">
<title>Order files</title>
<indexterm role="cp"><primary>handling build order</primary></indexterm>

<para>The order command has the purpose of resolving the build order through
.order files.  An order file contains a list of recipe names, by default
does not perform any action other than to print a resolved list in
descending order.  For example, if <emphasis role="bold">a</emphasis> depends on <emphasis role="bold">b</emphasis> and
<emphasis role="bold">c</emphasis>, and <emphasis role="bold">c</emphasis> depends on <emphasis role="bold">b</emphasis> as well, the file might
look like:
</para>
<screen>a: c b
b:
c: b
</screen>
<para>Each letter represents a recipe name, complete dependencies for
the first recipe name are listed in descending order, which is
printed from right to left, and removed from left to right:
</para>
<para>OUTPUT
</para>
<screen>b
c
a
</screen>
<para>Blank lines, colons and parentheses are simply ignored.  Comment lines
beginning with &#8216;<literal>#</literal>&#8217; are allowed.
</para>
<para>An order file could be used to build a series of packages, for example,
if the content is:
</para>
<screen># Image handling libraries

libs/libjpeg-turbo: devel/nasm
x-libs/jasper: libs/libjpeg-turbo
libs/tiff: libs/libjpeg-turbo
</screen>
<para>To proceed with each recipe, we can type:
</para>
<screen>qi order imglibs.order | qi build --install -
</screen>
<para>The output of &#8216;<literal>qi order imglibs.order</literal>&#8217; tells to qi in which order it
should build the recipes:
</para>
<screen>devel/nasm
libs/libjpeg-turbo
x-libs/jasper
libs/tiff
</screen>

</chapter>
<chapter label="18" id="Creating-packages">
<title>Creating packages</title>
<indexterm role="cp"><primary>package creation</primary></indexterm>

<para>The creation command is an internal function of qi to make new Qi
compatible packages.  A package is produced using the contents of
the Current Working Directory and the package file is written out.
</para>
<screen>Usage: qi create [<replaceable>Output/PackageName.tlz</replaceable>]...
</screen>
<para>The argument for the file name to be written must contain a fully
qualified named directory as the output directory where the package
produced will be written.  The file name should be composed using the
full name: name-version-architecture-release[@pkgcategory].tlz
</para>
<para>EXAMPLE
</para>
<screen>cd /usr/pkg
cd claws-mail_3.17.1_amd64-1@x-apps
qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
</screen>
<para>In this case, the package &quot;claws-mail_3.17.1_amd64-1@x-apps&quot; will be
written into &#8216;<literal>/var/cache/qi/packages/</literal>&#8217;.
</para>
<para>All packages produced are complemented by a checksum file (.sha256).
</para>

</chapter>
<chapter label="19" id="Examining-packages">
<title>Examining packages</title>
<indexterm role="cp"><primary>package examination</primary></indexterm>

<para>The extraction command serves to examine binary packages for debugging
purposes. It decompresses a package into a single directory, verifying
its integrity and preserving all of its properties (owner and permissions).
</para>
<screen>Usage: qi extract [<replaceable>packagename.tlz</replaceable>]...
</screen>
<para>EXAMPLE
</para>
<screen>qi extract mksh_R56c_amd64-1@shells.tlz
</screen>
<para>This action will put the content of &quot;mksh_R56c_amd64-1@shells.tlz&quot; into a
single directory, this is a private directory for the user who requested
the action, creation operation will be equal to <emphasis role="bold">u=rwx,g=,o= (0700)</emphasis>.
The package content will reside on this location, default mask to deploy
the content will be equal to <emphasis role="bold">u=rwx,g=rwx,o=rwx (0000)</emphasis>.
</para>
<para>Note: the creation of the custom directory is influenced by the value
of the <envar>TMPDIR</envar> variable.
</para>

</chapter>
<chapter label="20" id="Qi-exit-status">
<title>Qi exit status</title>
<indexterm role="cp"><primary>exit codes</primary></indexterm>

<para>All the exit codes are described in this chapter.
</para>
<variablelist><varlistentry><term>&#8216;<literal>0</literal>&#8217;
</term><listitem><para>Successful completion (no errors).
</para>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>1</literal>&#8217;
</term><listitem><para>Minor common errors:
</para>
<itemizedlist><listitem><para>Help usage on invalid options or required arguments.
</para>
</listitem><listitem><para>Program needed by qi (prerequisite) is not available.
</para></listitem></itemizedlist>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>2</literal>&#8217;
</term><listitem><para>Command execution error:
</para>
<para>This code is used to return the evaluation of an external command or shell
arguments in case of failure.
</para>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>3</literal>&#8217;
</term><listitem><para>Integrity check error for compressed files.
</para>
<para>Compressed files means:
</para>
<itemizedlist><listitem><para>A tarball file from tar(1), typically handled by the GNU tar implementation.
Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
.tar.xz, .txz, .tar.zst, .tzst
</para>
</listitem><listitem><para>A tarball file from tarlz(1).
Supported extensions: .tar.lz, .tlz
</para>
</listitem><listitem><para>Zip files from unzip(1).
Supported extensions: .zip, .ZIP
</para>
</listitem><listitem><para>Gzip files from gzip(1).
Supported extensions: .gz, .Z
</para>
</listitem><listitem><para>Bzip2 files from bzip2(1).
Supported extension: .bz2
</para>
</listitem><listitem><para>Lzip files from lzip(1).
Supported extension: .lz
</para>
</listitem><listitem><para>Xz files from xz(1).
Supported extension: .xz
</para>
</listitem><listitem><para>Zstd files from zstd(1).
Supported extension: .zst
</para></listitem></itemizedlist>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>4</literal>&#8217;
</term><listitem><para>File empty, not regular, or expected.
</para>
<para>It&#8217;s commonly expected:
</para>
<itemizedlist><listitem><para>An argument for giving commands.
</para>
</listitem><listitem><para>A regular file or readable directory.
</para>
</listitem><listitem><para>An expected extension: .tlz, .sha256, .order.
</para>
</listitem><listitem><para>A protocol supported by the network downloader tool.
</para></listitem></itemizedlist>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>5</literal>&#8217;
</term><listitem><para>Empty or not defined variable:
</para>
<para>This code is used to report empty or undefined variables (usually
variables coming from a recipe or assigned arrays that are tested).
</para>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>6</literal>&#8217;
</term><listitem><para>Package already installed:
</para>
<para>The package directory for an incoming .tlz package already exists.
</para>
</listitem></varlistentry><varlistentry><term>&#8216;<literal>10</literal>&#8217;
</term><listitem><para>Network manager error:
</para>
<para>This code is used if the network downloader tool fails for some reason.
</para></listitem></varlistentry></variablelist>

</chapter>
<chapter label="21" id="Getting-support">
<title>Getting support</title>
<indexterm role="cp"><primary>getting support</primary></indexterm>

<para>Dragora&#8217;s home page can be found at <ulink url="https://www.dragora.org">https://www.dragora.org</ulink>.
&#160;Bug reports or suggestions can be sent to <email>dragora-users@nongnu.org</email>.
</para>
</chapter>
<chapter label="22" id="Contributing-to-Dragora">
<title>Contributing to Dragora</title>
<indexterm role="cp"><primary>contributing to dragora</primary></indexterm>

<para>TODO (introductory text here).
</para>
<sect1 label="22.1">
<title>How to place a mirror</title>
<indexterm role="cp"><primary>how to place a mirror</primary></indexterm>

<para>If there&#8217;s no Dragora mirror near you, you&#8217;re welcome to contribute one.
</para>
<para>First, for users or downloaders, the address <emphasis>rsync://rsync.dragora.org/</emphasis>
contains ISO images and source code (in various formats) taken from the
original sites and distributed by Dragora.
</para>
<para>Mirroring the Dragora server requires approximately 13GB of disk space (as
of January 2022).  You can hit rsync directly from <emphasis>rsync.dragora.org</emphasis> as:
</para>
<para><literal>rsync -rltpHS --delete-excluded rsync://rsync.dragora.org/dragora /your/dir/</literal>
</para>
<para>Also, consider mirroring from another site in order to reduce load on the
Dragora server.  The listed sites at
<ulink url="https://www.dragora.org/en/get/mirrors/index.html">https://www.dragora.org/en/get/mirrors/index.html</ulink> provide access to all
the material on rsync.dragora.org.  They update from us nightly (at least),
and you may access them via rsync with the same options as above.
</para>
<para>Note:
</para>
<para>We keep a file called &quot;timestamp&quot; under the main tree after each
synchronization.  This file can be used to verify, instead of synchronizing
all the content at once, you can check if this file has been updated and
then continue with the full synchronization.
</para>

</sect1>
</chapter>
<appendix label="A" id="GNU-Free-Documentation-License">
<title>GNU Free Documentation License</title>

<!-- The GNU Free Documentation License. -->
Version 1.3, 3 November 2008

<!-- This file is intended to be included within another document, -->
<!-- hence no sectioning command or @node. -->

<literallayout>Copyright &#169; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
<ulink url="https://fsf.org/">https://fsf.org/</ulink>

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</literallayout>
<orderedlist numeration="arabic"><listitem><para>PREAMBLE
</para>
<para>The purpose of this License is to make a manual, textbook, or other
functional and useful document <firstterm>free</firstterm> in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
</para>
<para>This License is a kind of &#8220;copyleft&#8221;, which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.
</para>
<para>We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.
</para>
</listitem><listitem><para>APPLICABILITY AND DEFINITIONS
</para>
<para>This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The &#8220;Document&#8221;, below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as &#8220;you&#8221;.  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
</para>
<para>A &#8220;Modified Version&#8221; of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
</para>
<para>A &#8220;Secondary Section&#8221; is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document&#8217;s overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
</para>
<para>The &#8220;Invariant Sections&#8221; are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.
</para>
<para>The &#8220;Cover Texts&#8221; are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
</para>
<para>A &#8220;Transparent&#8221; copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not &#8220;Transparent&#8221; is called &#8220;Opaque&#8221;.
</para>
<para>Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, La&tex; input
format, SGML or XML using a publicly available
DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification.  Examples
of transparent image formats include PNG, XCF and
JPG.  Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are
not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for
output purposes only.
</para>
<para>The &#8220;Title Page&#8221; means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, &#8220;Title Page&#8221; means
the text near the most prominent appearance of the work&#8217;s title,
preceding the beginning of the body of the text.
</para>
<para>The &#8220;publisher&#8221; means any person or entity that distributes copies
of the Document to the public.
</para>
<para>A section &#8220;Entitled XYZ&#8221; means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as &#8220;Acknowledgements&#8221;,
&#8220;Dedications&#8221;, &#8220;Endorsements&#8221;, or &#8220;History&#8221;.)  To &#8220;Preserve the Title&#8221;
of such a section when you modify the Document means that it remains a
section &#8220;Entitled XYZ&#8221; according to this definition.
</para>
<para>The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
</para>
</listitem><listitem><para>VERBATIM COPYING
</para>
<para>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</para>
<para>You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
</para>
</listitem><listitem><para>COPYING IN QUANTITY
</para>
<para>If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document&#8217;s license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
</para>
<para>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
</para>
<para>If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
</para>
<para>It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
</para>
</listitem><listitem><para>MODIFICATIONS
</para>
<para>You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:
</para>
<orderedlist numeration="upperalpha"><listitem><para>Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document).  You may use the same title as a previous version
if the original publisher of that version gives permission.
</para>
</listitem><listitem><para>List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
</para>
</listitem><listitem><para>State on the Title page the name of the publisher of the
Modified Version, as the publisher.
</para>
</listitem><listitem><para>Preserve all the copyright notices of the Document.
</para>
</listitem><listitem><para>Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
</para>
</listitem><listitem><para>Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
</para>
</listitem><listitem><para>Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document&#8217;s license notice.
</para>
</listitem><listitem><para>Include an unaltered copy of this License.
</para>
</listitem><listitem><para>Preserve the section Entitled &#8220;History&#8221;, Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page.  If
there is no section Entitled &#8220;History&#8221; in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
</para>
</listitem><listitem><para>Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on.  These may be placed in the &#8220;History&#8221; section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
</para>
</listitem><listitem><para>For any section Entitled &#8220;Acknowledgements&#8221; or &#8220;Dedications&#8221;, Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
</para>
</listitem><listitem><para>Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles.  Section numbers
or the equivalent are not considered part of the section titles.
</para>
</listitem><listitem><para>Delete any section Entitled &#8220;Endorsements&#8221;.  Such a section
may not be included in the Modified Version.
</para>
</listitem><listitem><para>Do not retitle any existing section to be Entitled &#8220;Endorsements&#8221; or
to conflict in title with any Invariant Section.
</para>
</listitem><listitem><para>Preserve any Warranty Disclaimers.
</para></listitem></orderedlist>
<para>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version&#8217;s license notice.
These titles must be distinct from any other section titles.
</para>
<para>You may add a section Entitled &#8220;Endorsements&#8221;, provided it contains
nothing but endorsements of your Modified Version by various
parties&#8212;for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
</para>
<para>You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
</para>
<para>The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
</para>
</listitem><listitem><para>COMBINING DOCUMENTS
</para>
<para>You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
</para>
<para>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
</para>
<para>In the combination, you must combine any sections Entitled &#8220;History&#8221;
in the various original documents, forming one section Entitled
&#8220;History&#8221;; likewise combine any sections Entitled &#8220;Acknowledgements&#8221;,
and any sections Entitled &#8220;Dedications&#8221;.  You must delete all
sections Entitled &#8220;Endorsements.&#8221;
</para>
</listitem><listitem><para>COLLECTIONS OF DOCUMENTS
</para>
<para>You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
</para>
<para>You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
</para>
</listitem><listitem><para>AGGREGATION WITH INDEPENDENT WORKS
</para>
<para>A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an &#8220;aggregate&#8221; if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation&#8217;s users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
</para>
<para>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document&#8217;s Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
</para>
</listitem><listitem><para>TRANSLATION
</para>
<para>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
</para>
<para>If a section in the Document is Entitled &#8220;Acknowledgements&#8221;,
&#8220;Dedications&#8221;, or &#8220;History&#8221;, the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
</para>
</listitem><listitem><para>TERMINATION
</para>
<para>You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.
</para>
<para>However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
</para>
<para>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
</para>
<para>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
</para>
</listitem><listitem><para>FUTURE REVISIONS OF THIS LICENSE
</para>
<para>The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
<ulink url="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</ulink>.
</para>
<para>Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License &#8220;or any later version&#8221; applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.  If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy&#8217;s public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.
</para>
</listitem><listitem><para>RELICENSING
</para>
<para>&#8220;Massive Multiauthor Collaboration Site&#8221; (or &#8220;MMC Site&#8221;) means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works.  A
public wiki that anybody can edit is an example of such a server.  A
&#8220;Massive Multiauthor Collaboration&#8221; (or &#8220;MMC&#8221;) contained in the
site means any set of copyrightable works thus published on the MMC
site.
</para>
<para>&#8220;CC-BY-SA&#8221; means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
</para>
<para>&#8220;Incorporate&#8221; means to publish or republish a Document, in whole or
in part, as part of another Document.
</para>
<para>An MMC is &#8220;eligible for relicensing&#8221; if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
</para>
<para>The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
</para>
</listitem></orderedlist>
<bridgehead renderas="sect1">ADDENDUM: How to use this License for your documents</bridgehead>

<para>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
</para>
<screen>  Copyright (C)  <replaceable>year</replaceable>  <replaceable>your name</replaceable>.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.3
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled ``GNU
  Free Documentation License''.
</screen>
<para>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the &#8220;with&#8230;Texts.&#8221; line with this:
</para>
<screen>    with the Invariant Sections being <replaceable>list their titles</replaceable>, with
    the Front-Cover Texts being <replaceable>list</replaceable>, and with the Back-Cover Texts
    being <replaceable>list</replaceable>.
</screen>
<para>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
</para>
<para>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
</para>
<!-- Local Variables: -->
<!-- ispell-local-pdict: "ispell-dict" -->
<!-- End: -->

</appendix>
<chapter label="" id="Index">
<title>Index</title>

<index role="cp"></index>

</chapter>
</book>
